package com.sdwl.brcl.validation.exception;


import com.sdwl.brcl.validation.enums.EnumAware;

/**
 * @author xied
 * @date 2021年06月11日 14:19
 */
public class MoonException extends RuntimeException {
    private final String errCode;

    public MoonException(EnumAware enumAware, Throwable e) {
        super(enumAware.getName(), e);
        this.errCode = enumAware.getCode();
    }

    public MoonException(EnumAware enumAware) {
        super(enumAware.getName());
        this.errCode = enumAware.getCode();
    }

    public MoonException(String errorCode, String errorMsg) {
        super(errorMsg);
        this.errCode = errorCode;
    }

    public MoonException(String errorCode, String errorMsg, Throwable e) {
        super(errorMsg, e);
        this.errCode = errorCode;
    }

    public String getErrCode() {
        return this.errCode;
    }

    @Override
    public Throwable fillInStackTrace() {
        return this;
    }
}
